/* eslint no-underscore-dangle: 0 */
import React, { Component } from 'react';
import classnames from 'classnames';
import styles from './index.module.scss';
import { Button } from '@alifd/next';


export default class nImg extends Component {
    constructor(props) {
        super(props);

        this.state = {
            isFull: false,
        };
    }

    componentDidMount() {
        this.init();
    }
    componentWillReceiveProps() {

    }
  init = async () => {

  }
  componentWillUnmount() {

  }


  fullScreen = () => {
      this.setState({
          isFull: !this.state.isFull,
      });
  }

  render() {
      return (


          <div className={classnames(this.state.isFull ? styles.wrap2 : styles.wrap1, styles.nImg, !this.props.unRelative ? styles.unRelative : null)} >

              <img src={this.props.mapBase64} alt="" />
              {
                  this.props.showFullButton ? <Button type="primary" onClick={this.fullScreen} className={styles.button} >
              切换
                  </Button> : null
              }


          </div>

      );
  }
}
